(0) Obligation:

Clauses:

half(0, 0).
half(s(0), 0).
half(s(s(X)), s(Y)) :- half(X, Y).
log(0, s(0)).
log(s(X), s(Y)) :- ','(half(s(X), Z), log(Z, Y)).

Query: log(g,a)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

halfA(0, 0).
halfA(s(0), 0).
halfA(s(s(T14)), s(X27)) :- halfA(T14, X27).
logB(0, s(0)).
logB(s(0), s(s(0))).
logB(s(s(T10)), s(T7)) :- halfA(T10, X18).
logB(s(s(T10)), s(T7)) :- ','(halfA(T10, T11), logB(s(T11), T7)).

Query: logB(g,a)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
logB_in: (b,f)
halfA_in: (b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

logB_in_ga(0, s(0)) → logB_out_ga(0, s(0))
logB_in_ga(s(0), s(s(0))) → logB_out_ga(s(0), s(s(0)))
logB_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, halfA_in_ga(T10, X18))
halfA_in_ga(0, 0) → halfA_out_ga(0, 0)
halfA_in_ga(s(0), 0) → halfA_out_ga(s(0), 0)
halfA_in_ga(s(s(T14)), s(X27)) → U1_ga(T14, X27, halfA_in_ga(T14, X27))
U1_ga(T14, X27, halfA_out_ga(T14, X27)) → halfA_out_ga(s(s(T14)), s(X27))
U2_ga(T10, T7, halfA_out_ga(T10, X18)) → logB_out_ga(s(s(T10)), s(T7))
logB_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, halfA_in_ga(T10, T11))
U3_ga(T10, T7, halfA_out_ga(T10, T11)) → U4_ga(T10, T7, logB_in_ga(s(T11), T7))
U4_ga(T10, T7, logB_out_ga(s(T11), T7)) → logB_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logB_in_ga(x1, x2)  =  logB_in_ga(x1)
0  =  0
logB_out_ga(x1, x2)  =  logB_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
halfA_in_ga(x1, x2)  =  halfA_in_ga(x1)
halfA_out_ga(x1, x2)  =  halfA_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

logB_in_ga(0, s(0)) → logB_out_ga(0, s(0))
logB_in_ga(s(0), s(s(0))) → logB_out_ga(s(0), s(s(0)))
logB_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, halfA_in_ga(T10, X18))
halfA_in_ga(0, 0) → halfA_out_ga(0, 0)
halfA_in_ga(s(0), 0) → halfA_out_ga(s(0), 0)
halfA_in_ga(s(s(T14)), s(X27)) → U1_ga(T14, X27, halfA_in_ga(T14, X27))
U1_ga(T14, X27, halfA_out_ga(T14, X27)) → halfA_out_ga(s(s(T14)), s(X27))
U2_ga(T10, T7, halfA_out_ga(T10, X18)) → logB_out_ga(s(s(T10)), s(T7))
logB_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, halfA_in_ga(T10, T11))
U3_ga(T10, T7, halfA_out_ga(T10, T11)) → U4_ga(T10, T7, logB_in_ga(s(T11), T7))
U4_ga(T10, T7, logB_out_ga(s(T11), T7)) → logB_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logB_in_ga(x1, x2)  =  logB_in_ga(x1)
0  =  0
logB_out_ga(x1, x2)  =  logB_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
halfA_in_ga(x1, x2)  =  halfA_in_ga(x1)
halfA_out_ga(x1, x2)  =  halfA_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

LOGB_IN_GA(s(s(T10)), s(T7)) → U2_GA(T10, T7, halfA_in_ga(T10, X18))
LOGB_IN_GA(s(s(T10)), s(T7)) → HALFA_IN_GA(T10, X18)
HALFA_IN_GA(s(s(T14)), s(X27)) → U1_GA(T14, X27, halfA_in_ga(T14, X27))
HALFA_IN_GA(s(s(T14)), s(X27)) → HALFA_IN_GA(T14, X27)
LOGB_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, halfA_in_ga(T10, T11))
U3_GA(T10, T7, halfA_out_ga(T10, T11)) → U4_GA(T10, T7, logB_in_ga(s(T11), T7))
U3_GA(T10, T7, halfA_out_ga(T10, T11)) → LOGB_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

logB_in_ga(0, s(0)) → logB_out_ga(0, s(0))
logB_in_ga(s(0), s(s(0))) → logB_out_ga(s(0), s(s(0)))
logB_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, halfA_in_ga(T10, X18))
halfA_in_ga(0, 0) → halfA_out_ga(0, 0)
halfA_in_ga(s(0), 0) → halfA_out_ga(s(0), 0)
halfA_in_ga(s(s(T14)), s(X27)) → U1_ga(T14, X27, halfA_in_ga(T14, X27))
U1_ga(T14, X27, halfA_out_ga(T14, X27)) → halfA_out_ga(s(s(T14)), s(X27))
U2_ga(T10, T7, halfA_out_ga(T10, X18)) → logB_out_ga(s(s(T10)), s(T7))
logB_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, halfA_in_ga(T10, T11))
U3_ga(T10, T7, halfA_out_ga(T10, T11)) → U4_ga(T10, T7, logB_in_ga(s(T11), T7))
U4_ga(T10, T7, logB_out_ga(s(T11), T7)) → logB_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logB_in_ga(x1, x2)  =  logB_in_ga(x1)
0  =  0
logB_out_ga(x1, x2)  =  logB_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
halfA_in_ga(x1, x2)  =  halfA_in_ga(x1)
halfA_out_ga(x1, x2)  =  halfA_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
LOGB_IN_GA(x1, x2)  =  LOGB_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x3)
HALFA_IN_GA(x1, x2)  =  HALFA_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
U3_GA(x1, x2, x3)  =  U3_GA(x3)
U4_GA(x1, x2, x3)  =  U4_GA(x3)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LOGB_IN_GA(s(s(T10)), s(T7)) → U2_GA(T10, T7, halfA_in_ga(T10, X18))
LOGB_IN_GA(s(s(T10)), s(T7)) → HALFA_IN_GA(T10, X18)
HALFA_IN_GA(s(s(T14)), s(X27)) → U1_GA(T14, X27, halfA_in_ga(T14, X27))
HALFA_IN_GA(s(s(T14)), s(X27)) → HALFA_IN_GA(T14, X27)
LOGB_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, halfA_in_ga(T10, T11))
U3_GA(T10, T7, halfA_out_ga(T10, T11)) → U4_GA(T10, T7, logB_in_ga(s(T11), T7))
U3_GA(T10, T7, halfA_out_ga(T10, T11)) → LOGB_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

logB_in_ga(0, s(0)) → logB_out_ga(0, s(0))
logB_in_ga(s(0), s(s(0))) → logB_out_ga(s(0), s(s(0)))
logB_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, halfA_in_ga(T10, X18))
halfA_in_ga(0, 0) → halfA_out_ga(0, 0)
halfA_in_ga(s(0), 0) → halfA_out_ga(s(0), 0)
halfA_in_ga(s(s(T14)), s(X27)) → U1_ga(T14, X27, halfA_in_ga(T14, X27))
U1_ga(T14, X27, halfA_out_ga(T14, X27)) → halfA_out_ga(s(s(T14)), s(X27))
U2_ga(T10, T7, halfA_out_ga(T10, X18)) → logB_out_ga(s(s(T10)), s(T7))
logB_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, halfA_in_ga(T10, T11))
U3_ga(T10, T7, halfA_out_ga(T10, T11)) → U4_ga(T10, T7, logB_in_ga(s(T11), T7))
U4_ga(T10, T7, logB_out_ga(s(T11), T7)) → logB_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logB_in_ga(x1, x2)  =  logB_in_ga(x1)
0  =  0
logB_out_ga(x1, x2)  =  logB_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
halfA_in_ga(x1, x2)  =  halfA_in_ga(x1)
halfA_out_ga(x1, x2)  =  halfA_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
LOGB_IN_GA(x1, x2)  =  LOGB_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x3)
HALFA_IN_GA(x1, x2)  =  HALFA_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
U3_GA(x1, x2, x3)  =  U3_GA(x3)
U4_GA(x1, x2, x3)  =  U4_GA(x3)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 2 SCCs with 4 less nodes.

(8) Complex Obligation (AND)

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HALFA_IN_GA(s(s(T14)), s(X27)) → HALFA_IN_GA(T14, X27)

The TRS R consists of the following rules:

logB_in_ga(0, s(0)) → logB_out_ga(0, s(0))
logB_in_ga(s(0), s(s(0))) → logB_out_ga(s(0), s(s(0)))
logB_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, halfA_in_ga(T10, X18))
halfA_in_ga(0, 0) → halfA_out_ga(0, 0)
halfA_in_ga(s(0), 0) → halfA_out_ga(s(0), 0)
halfA_in_ga(s(s(T14)), s(X27)) → U1_ga(T14, X27, halfA_in_ga(T14, X27))
U1_ga(T14, X27, halfA_out_ga(T14, X27)) → halfA_out_ga(s(s(T14)), s(X27))
U2_ga(T10, T7, halfA_out_ga(T10, X18)) → logB_out_ga(s(s(T10)), s(T7))
logB_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, halfA_in_ga(T10, T11))
U3_ga(T10, T7, halfA_out_ga(T10, T11)) → U4_ga(T10, T7, logB_in_ga(s(T11), T7))
U4_ga(T10, T7, logB_out_ga(s(T11), T7)) → logB_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logB_in_ga(x1, x2)  =  logB_in_ga(x1)
0  =  0
logB_out_ga(x1, x2)  =  logB_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
halfA_in_ga(x1, x2)  =  halfA_in_ga(x1)
halfA_out_ga(x1, x2)  =  halfA_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
HALFA_IN_GA(x1, x2)  =  HALFA_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(10) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(11) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HALFA_IN_GA(s(s(T14)), s(X27)) → HALFA_IN_GA(T14, X27)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
HALFA_IN_GA(x1, x2)  =  HALFA_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(12) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(13) Obligation:

Q DP problem:
The TRS P consists of the following rules:

HALFA_IN_GA(s(s(T14))) → HALFA_IN_GA(T14)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(14) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • HALFA_IN_GA(s(s(T14))) → HALFA_IN_GA(T14)
    The graph contains the following edges 1 > 1

(15) YES

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LOGB_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, halfA_in_ga(T10, T11))
U3_GA(T10, T7, halfA_out_ga(T10, T11)) → LOGB_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

logB_in_ga(0, s(0)) → logB_out_ga(0, s(0))
logB_in_ga(s(0), s(s(0))) → logB_out_ga(s(0), s(s(0)))
logB_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, halfA_in_ga(T10, X18))
halfA_in_ga(0, 0) → halfA_out_ga(0, 0)
halfA_in_ga(s(0), 0) → halfA_out_ga(s(0), 0)
halfA_in_ga(s(s(T14)), s(X27)) → U1_ga(T14, X27, halfA_in_ga(T14, X27))
U1_ga(T14, X27, halfA_out_ga(T14, X27)) → halfA_out_ga(s(s(T14)), s(X27))
U2_ga(T10, T7, halfA_out_ga(T10, X18)) → logB_out_ga(s(s(T10)), s(T7))
logB_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, halfA_in_ga(T10, T11))
U3_ga(T10, T7, halfA_out_ga(T10, T11)) → U4_ga(T10, T7, logB_in_ga(s(T11), T7))
U4_ga(T10, T7, logB_out_ga(s(T11), T7)) → logB_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logB_in_ga(x1, x2)  =  logB_in_ga(x1)
0  =  0
logB_out_ga(x1, x2)  =  logB_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
halfA_in_ga(x1, x2)  =  halfA_in_ga(x1)
halfA_out_ga(x1, x2)  =  halfA_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
LOGB_IN_GA(x1, x2)  =  LOGB_IN_GA(x1)
U3_GA(x1, x2, x3)  =  U3_GA(x3)

We have to consider all (P,R,Pi)-chains

(17) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(18) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LOGB_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, halfA_in_ga(T10, T11))
U3_GA(T10, T7, halfA_out_ga(T10, T11)) → LOGB_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

halfA_in_ga(0, 0) → halfA_out_ga(0, 0)
halfA_in_ga(s(0), 0) → halfA_out_ga(s(0), 0)
halfA_in_ga(s(s(T14)), s(X27)) → U1_ga(T14, X27, halfA_in_ga(T14, X27))
U1_ga(T14, X27, halfA_out_ga(T14, X27)) → halfA_out_ga(s(s(T14)), s(X27))

The argument filtering Pi contains the following mapping:
0  =  0
s(x1)  =  s(x1)
halfA_in_ga(x1, x2)  =  halfA_in_ga(x1)
halfA_out_ga(x1, x2)  =  halfA_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
LOGB_IN_GA(x1, x2)  =  LOGB_IN_GA(x1)
U3_GA(x1, x2, x3)  =  U3_GA(x3)

We have to consider all (P,R,Pi)-chains

(19) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LOGB_IN_GA(s(s(T10))) → U3_GA(halfA_in_ga(T10))
U3_GA(halfA_out_ga(T11)) → LOGB_IN_GA(s(T11))

The TRS R consists of the following rules:

halfA_in_ga(0) → halfA_out_ga(0)
halfA_in_ga(s(0)) → halfA_out_ga(0)
halfA_in_ga(s(s(T14))) → U1_ga(halfA_in_ga(T14))
U1_ga(halfA_out_ga(X27)) → halfA_out_ga(s(X27))

The set Q consists of the following terms:

halfA_in_ga(x0)
U1_ga(x0)

We have to consider all (P,Q,R)-chains.

(21) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

LOGB_IN_GA(s(s(T10))) → U3_GA(halfA_in_ga(T10))
U3_GA(halfA_out_ga(T11)) → LOGB_IN_GA(s(T11))

Strictly oriented rules of the TRS R:

halfA_in_ga(0) → halfA_out_ga(0)
halfA_in_ga(s(0)) → halfA_out_ga(0)
halfA_in_ga(s(s(T14))) → U1_ga(halfA_in_ga(T14))
U1_ga(halfA_out_ga(X27)) → halfA_out_ga(s(X27))

Used ordering: Knuth-Bendix order [KBO] with precedence:
U3GA1 > LOGBINGA1 > s1 > halfAinga1 > halfAoutga1 > 0 > U1ga1

and weight map:

0=1
halfA_in_ga_1=7
halfA_out_ga_1=6
s_1=4
U1_ga_1=5
LOGB_IN_GA_1=5
U3_GA_1=3

The variable weight is 1

(22) Obligation:

Q DP problem:
P is empty.
R is empty.
The set Q consists of the following terms:

halfA_in_ga(x0)
U1_ga(x0)

We have to consider all (P,Q,R)-chains.

(23) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(24) YES